<?php
namespace app\common\model;

class ProductSku extends Base
{
    protected $name = 'product_sku';

    public function getSkuList($product_id = 0)
    {
        if(!$product_id){
            return [];
        }

        $list = $this->alias('ps')
            ->join('sku s', 'ps.sku_id = s.id')
            ->where('ps.product_id', $product_id)
            ->field('s.id, s.name')
            ->select();

        return $list;
    }
}